#pragma once

#include <string>
#include <WINSOCK.H>

#pragma comment(lib, "WSOCK32.LIB")

using namespace std;

class ClientSocket
{
public:
	ClientSocket(void);
	~ClientSocket(void);
private:
	SOCKET m_sock;
	sockaddr_in m_addr;
	bool Is_Valid() const { return m_sock != -1;}
public:
	bool Create(void);
	bool Connect(string host, int port);
	int Send(char * ptr, int len);
	int Receive(char * buffer, int len);
	void Close(void);
};
